package it.example.pad;

//import android.util.Log;
import it.example.pad.mouseComponent.Button;
import it.example.pad.mouseComponent.Pad;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;

public class ClickListener implements OnTouchListener {

	private Button dx, sx;
	private Pad pad;
	public Button getDx() {
		return dx;
	}
	public void setDx(Button dx) {
		this.dx = dx;
	}
	public Button getSx() {
		return sx;
	}
	public void setSx(Button sx) {
		this.sx = sx;
	}
	public Pad getPad() {
		return pad;
	}
	public void setPad(Pad pad) {
		this.pad = pad;
	}
	public boolean onTouch(View v, MotionEvent event) {
//		Log.d("AAAA", event.getX()+" "+event.getY());
		if(dx!=null)
			dx.receiveEvent(event);
		if(sx!=null)
			sx.receiveEvent(event);
		if(pad!=null)
			pad.receiveEvent(event);
		return true;
	}
}